<beans:beans
    xmlns="http://www.springframework.org/schema/security"
    xmlns:beans="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd
    ">

    <beans:bean id="csrfSecurityRequestMatcher" class="com.structurizr.onpremises.web.security.CsrfSecurityRequestMatcher" />

    <http>
        <form-login login-page="/signin"
                    default-target-url="/dashboard"
                    authentication-success-handler-ref="authenticationSuccessHandler"
                    authentication-failure-handler-ref="authenticationFailureHandler" />
        <logout logout-success-url="/" invalidate-session="true" delete-cookies="JSESSIONID" />

        <headers>
            <frame-options disabled="true" />
        </headers>

        <csrf request-matcher-ref="csrfSecurityRequestMatcher" />
        <intercept-url pattern="/**" access="permitAll" />
    </http>

    <!--
        Place your LDAP configuration in the file below.
    -->
    <beans:import resource="file:${structurizr.dataDirectory}/ldap.xml" />

</beans:beans>